const nodata = require('../tw-lib-base/no-data/props')
const mapjson = require('./mapjson.js')
// const commonProps = require('../tw-lib-base/chart/common-props')
// const axisProps = require('../tw-lib-base/chart/axis-props')
// const datazoomProps = require('../tw-lib-base/chart/datazoom-props')
// const tooltipProps = require('../tw-lib-base/chart/tooltip-props')

module.exports = {
  // ...commonProps,

  // ...axisProps,
  // ...datazoomProps,
  // ...tooltipProps,

  data: {
    type: Array,
    default () {
      return [
        ['柱状图', '数量'],
        ['2020-06-05', 1],
        ['2020-06-12', 2],
        ['2020-06-19', 3],
        ['2020-06-25', 4]
      ]
    },
    name: '图表数据集',
    filedType: 'api'
  },
  height: {
    type: String,
    default: '160px',
    name: '图表容器高度',
    filedType: 'string'
  },

  width: {
    type: String,
    default: '300px',
    name: '图表容器高度',
    filedType: 'string'
  },

  bgColor: {
    type: String,
    default: '#fff',
    name: '背景颜色',
    filedType: 'color'
  },
  icons: {
    type: Array,
    default () {
      return []
    },
    name: '图标列表',
    nameTip: '使用this.icons调用',
    filedType: 'file',
    limit: 100,
    maxSize: 1024
  },
  fontFamily: {
    type: Array,
    default: '',
    name: '字体',
    nameTip: '使用this.fontFamily调用',
    filedType: 'select',
    options: [
      {
        name: '微软雅黑',
        value: 'Microsoft YaHei'
      },
      {
        name: '宋体',
        value: '宋体'
      },
      {
        name: '继承父元素',
        value: 'inherit'
      },
      {
        name: '液晶面板',
        value: 'digiface'
      },
      {
        name: 'Arial',
        value: 'Arial'
      },
      {
        name: 'Helvetica Neue',
        value: 'Helvetica Neue'
      },
      {
        name: 'Helvetica',
        value: 'Helvetica'
      }
    ]
  },

  colors: {
    type: Array,
    default () {
      return [
        '#657df5',
        '#ffb336',
        '#4ac7ff',
        '#2bd3bd',
        '#96e388',
        '#fecd63',
        '#1276ff',
        '#03d6ef',
        '#7114ff',
        '#b62ad1',
        '#f83818',
        '#ff9e13',
        '#ffc513',
        '#5bd917',
        '#17d9b2'
      ]
    },
    name: '调色板',
    nameTip: '图表按此处指定的值循环取色',
    filedType: 'list',
    subType: 'color',
    subDefault: '#2bd3bd',
    max: 30
  },
  funcOption: {
    type: Function,
    default: '',
    name: 'setOption函数',
    nameTip: '函数第一个参数传入的是页面this，需要自行调用this.chart.setOption和this.resize',
    filedType: 'function'
  },
  value: {
    type: String,
    default: 'undefined',
    name: '选中图形',
    filedType: 'value',
    dataSource: {
      from: 'list',
      type: 'array',
      labelKey: 'label',
      valueKey: 'value'
    }
  },

  ...mapjson,
  ...nodata
}
